package be.teletask.onvif.requests;

import be.teletask.onvif.listeners.OnvifResponseListener;
import be.teletask.onvif.models.AudioOutputConfigurationReq;
import be.teletask.onvif.models.OnvifMediaProfile;
import be.teletask.onvif.models.OnvifType;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * Created by Luke F on 07/08/2020.
 */
@Getter
@NoArgsConstructor
public class SetAudioOutputConfigurationRequest implements OnvifRequest {

    //Constants
    public static final String TAG = SetAudioOutputConfigurationRequest.class.getSimpleName();

    //Attributes
    private OnvifResponseListener listener;
    private AudioOutputConfigurationReq audioOutput;

    //Constructors
    public SetAudioOutputConfigurationRequest(AudioOutputConfigurationReq audioOutput) {
        this.audioOutput = audioOutput;
    }

    public SetAudioOutputConfigurationRequest(AudioOutputConfigurationReq audioOutput, OnvifResponseListener listener) {
        this.audioOutput = audioOutput;
        this.listener = listener;
    }

    //Properties

    @Override
    public String getXml() {
        return "<SetAudioOutputConfiguration xmlns=\"http://www.onvif.org/ver20/ptz/wsdl\">" +
                "<Configuration>" +
                "<token>" + audioOutput.getToken() + "</ProfileToken>" +
                "<OutputToken>" + audioOutput.getOutputToken() + "</OutputToken>" +
                "<OutputLevel>" + audioOutput.getOutputLevel() + "</OutputLevel>" +
                "</<Configuration>>" +
                "<ForcePersistence>" + audioOutput.getForcePersistence() + "</ForcePersistence>" +
                "</SetAudioOutputConfiguration>";
    }

    @Override
    public OnvifType getType() {
        return OnvifType.SET_AUDIO_OUT_PUT_CONFIGURATION;
    }

}
